package com.cltech.mapper;

import com.cltech.dto.SysRoleDto;
import com.cltech.entity.sys.SysRole;
import org.mapstruct.InheritConfiguration;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.springframework.data.domain.Page;

import java.util.List;

/**
 * Created by Administrator on 2019/4/8.
 */
@Mapper(componentModel = "spring")
public interface SysRoleMapper {
     SysRole dtoToEntity(SysRoleDto sysRoleDto);
     @InheritConfiguration
     List<SysRole> dtoToEntity(List<SysRoleDto> sysRoleDto);
     @InheritInverseConfiguration
     SysRoleDto entityToDto(SysRole sysRole);
     @InheritInverseConfiguration
     List<SysRoleDto> entityToDto(List<SysRole> sysRole);
     default Page<SysRoleDto> entityToDto(Page<SysRole> page){
          return page.map(this::entityToDto);
     }
}
